//
//  MyCollectionCell.m
//  EasyToTesco2.0
//
//  Created by 杨森 on 16/7/28.
//  Copyright © 2016年 EasyToTesco. All rights reserved.
//

#import "MyCollectionCell.h"

@implementation MyCollectionCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addUI];
    }
    return self;
}



- (void)addUI
{
     CGFloat Margin = 10;
    CGFloat selfHeight = HEIGHT/6;
    
    //收藏图片
    self.collectionImg = [[UIImageView alloc] init];
    [self.contentView addSubview:self.collectionImg];
    _collectionImg.frame = CGRectMake(0,0,WIDTH/3,selfHeight);
    
    //收藏名字
    self.collectionName = [[UILabel alloc] init];
    self.collectionName.font = [UIFont systemFontOfSize:14];
    self.collectionName.numberOfLines = 2;
    [self.contentView addSubview:self.collectionName];
    _collectionName.frame = CGRectMake(CGRectGetMaxX(_collectionImg.frame)+Margin,Margin,WIDTH-WIDTH/3-Margin*2-20,35);
    
    //收藏价格
    self.collectionPrice = [[UILabel alloc] init];
    self.collectionPrice.font = [UIFont systemFontOfSize:13];
    self.collectionPrice.textColor = DEFAULT_COLOR;
    [self.contentView addSubview:self.collectionPrice];
    _collectionPrice.frame = CGRectMake(_collectionName.x,selfHeight-25,50,20);
    
    //删除按钮
    self.collectionDelete = [[UIButton alloc] init];
    [self.collectionDelete setImage:[UIImage imageNamed:@"collectionDelete"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.collectionDelete];
    _collectionDelete.frame = CGRectMake(CGRectGetMaxX(_collectionName.frame),_collectionPrice.y,20, 20);

}

@end
